package com.project.bean;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;

import java.time.LocalDate;
@TableName("t_product")
public class ProductBean {
    @TableId(value = "pk_productId",type = IdType.AUTO)
    private Integer id;
    @TableField("p_img")
    private String img;
    @TableField("p_productName")
    private String name;
    @TableField("p_price")
    private Integer price;
    @TableField("p_producer")
    private String producer;//产地
    @TableField("p_date")
    private LocalDate date ;//生产日期
    @TableField(exist = false)
    private Integer saleNum;//售出数量

    public ProductBean() {
    }

    public ProductBean(String img, String name, Integer price, String producer, LocalDate date, Integer saleNum) {
        this.img = img;
        this.name = name;
        this.price = price;
        this.producer = producer;
        this.date = date;
        this.saleNum = saleNum;
    }

    public Integer getId() {
        return id;
    }

    public void setId(Integer id) {
        this.id = id;
    }

    public String getImg() {
        return img;
    }

    public void setImg(String img) {
        this.img = img;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public Integer getPrice() {
        return price;
    }

    public void setPrice(Integer price) {
        this.price = price;
    }

    public String getProducer() {
        return producer;
    }

    public void setProducer(String producer) {
        this.producer = producer;
    }

    public LocalDate getDate() {
        return date;
    }

    public void setDate(LocalDate date) {
        this.date = date;
    }

    public Integer getSaleNum() {
        return saleNum;
    }

    public void setSaleNum(Integer saleNum) {
        this.saleNum = saleNum;
    }

    @Override
    public String toString() {
        return "ProductBean{" +
                "id=" + id +
                ", img='" + img + '\'' +
                ", name='" + name + '\'' +
                ", price=" + price +
                ", producer='" + producer + '\'' +
                ", date=" + date +
                ", saleNum=" + saleNum +
                '}';
    }
}
